package com.zallds.flink.stream;

import org.apache.flink.core.io.SimpleVersionedSerializer;
import org.apache.flink.streaming.api.functions.sink.filesystem.BucketAssigner;
import org.apache.flink.streaming.api.functions.sink.filesystem.bucketassigners.SimpleVersionedStringSerializer;
import scala.Tuple2;

/**
 * Created by liujian on 2020/4/12.
 */
public class DayBucketAssigner implements BucketAssigner<Tuple2<String, String>, String> {

    public String getBucketId(Tuple2<String, String> tuple2, Context context) {
        return tuple2._1();
    }

    public SimpleVersionedSerializer<String> getSerializer() {
        return SimpleVersionedStringSerializer.INSTANCE;
    }
}
